<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('新增员工')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-employee-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <input name="name" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱：</label>
            <div class="col-sm-8">
                <input name="email" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年龄：</label>
            <div class="col-sm-8">
                <input name="age" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否管理员：</label>
            <div class="col-sm-8" th:with="type=${@dict.getType('sys_admin')}">
                <input name="admin"  type="radio" th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否冻结：</label>
            <div class="col-sm-8" th:with="st=${@dict.getType('sys_status')}">
                <input name="status"  type="radio" th:each="status : ${st}" th:text="${status.label}" th:value="${status.value}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">部门：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b" th:with="type=${@dict.getType('sys_department')}">
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script th:inline="javascript">
    var prefix = ctx + "/business/employee"
    $("#form-employee-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-employee-add').serialize());
        }
    }
</script>
</body>
</html>